/**
 * @file       Context_test.cpp
 * @brief      TODO
 * @author     Huabo Zheng
 * @date       Jan 20, 2012
 * @Copyright  2012, www.netgear.com Inc. All rights reserved.
 */

#include "Context.h"
#include "gtest/gtest.h"
#include "typedefine.h"
#include "Panel.h"
namespace NS_LCD_AFW
{
class CContext_test : public ::testing::Test
{
public:
	virtual void SetUp()
	{
	}
	virtual void TearDown()
	{
	}
};
TEST_F(CContext_test,test_defualtConstruction)
{
}
TEST_F(CContext_test,test_add)
{
	CContext ct;
	CPanel *pPanel = new CPanel();
	ct.add(pPanel);
	ct.add(NULL);
	EXPECT_EQ(pPanel,ct.getActivePanel());

	OBJ_DESTORY(pPanel);
}
TEST_F(CContext_test,test_getActivePanel)
{
	CContext ct;
	EXPECT_EQ(NULL, ct.getActivePanel());

	CPanel *pPanel = new CPanel();
	ct.add(pPanel);
	EXPECT_EQ(pPanel, ct.getActivePanel());

	OBJ_DESTORY(pPanel);

}
TEST_F(CContext_test,test_remove)
{
	CContext ct;
	EXPECT_EQ(NULL, ct.getActivePanel());

	CPanel *pPanel = new CPanel();
	ct.add(pPanel);
	EXPECT_EQ(pPanel, ct.getActivePanel());

	ct.remove(pPanel);
	EXPECT_EQ(NULL, ct.getActivePanel());

	OBJ_DESTORY(pPanel);

}
} /* namespace NS_LCD_AFW */
